﻿using Common.Contract.Authentication.Record;
using Common.Contract.Authentication.Request;
using Common.Contract.Authentication.Response;
using System;
using System.ServiceModel;
using System.Web;

namespace Common.Contract.Authentication
{
    [ServiceContract]
    public interface IAuthentication
    {
        #region Application Command
        [OperationContract]
        RetrieveApplicationResponse RetrieveApplication(RetrieveApplicationRequest request);

        [OperationContract]
        SearchApplicationsResponse SearchApplications(SearchApplicationsRequest request);
        #endregion

        #region User Command
        [OperationContract]
        ResponseRecord CheckLogin(UserRecord userRecord, HttpRequestBase Request = null);

        [OperationContract]
        RetrieveUserResponse RetrieveUserByUserName(RetrieveUserByUserNameRequest request);

        [OperationContract]
        UserRecord RetrieveUserByEmail(Guid applicationKey, string email);

        [OperationContract]
        ResponseRecord RegisterUser(RegisterUserRequest request);

        [OperationContract]
        ResponseRecord UpdateUser(UpdateUserRequest request);

        [OperationContract]
        RetrieveUsersResponse RetrieveUsers(RetrieveUsersRequest request);
        #endregion

        #region Role reference with Group | User Command
        [OperationContract]
        RetrieveGroupRolesResponse RetrieveGroupRoles(RetrieveGroupRolesRequest request);

        [OperationContract]
        RetrieveUserRolesResponse RetrieveUserRoles(RetrieveUserRolesRequest request);

        [OperationContract]
        ResponseRecord DeleteUserRoles(DeleteUserRolesRequest request);

        [OperationContract]
        ResponseRecord DeleteGroupRoles(DeleteGroupRolesRequest request);

        [OperationContract]
        ResponseRecord SaveGroupRoles(SaveGroupRolesRequest request);

        [OperationContract]
        ResponseRecord SaveUserRoles(SaveUserRolesRequest request);
        #endregion

        #region Role command
        [OperationContract]
        SearchRolesResponse SearchRoles(SearchRolesRequest request);

        [OperationContract]
        ResponseRecord AddRole(AddRoleRequest request);

        [OperationContract]
        ResponseRecord UpdateRole(UpdateRoleRequest request);

        [OperationContract]
        ResponseRecord DeleteRole(DeleteRoleRequest request);
        #endregion

        #region Object Command
        [OperationContract]
        ResponseRecord AddObject(AddObjectRequest request);

        [OperationContract]
        RetrieveObjectsResponse RetrieveObjects(RetrieveObjectsRequest request);

        [OperationContract]
        ResponseRecord DeleteObject(DeleteObjectRequest request);

        [OperationContract]
        ResponseRecord UpdateObject(UpdateObjectRequest request);
        #endregion

        #region Group Command
        [OperationContract]
        ResponseRecord DeleteGroup(DeleteGroupRequest request);

        [OperationContract]
        ResponseRecord UpdateGroup(UpdateGroupRequest request);

        [OperationContract]
        ResponseRecord AddGroup(AddGroupRequest request);

        [OperationContract]
        RetrieveGroupsResponse RetrieveGroups(RetrieveGroupsRequest request);
        #endregion
    }
}
